package com.wubotao.multithreading;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class TestConsumer {
	public static void main(String[] args) {
		BankCard bc = new BankCard();
		Lock lock = new ReentrantLock();
		ExecutorService pool = Executors.newCachedThreadPool();
		Consumer cm1 = new Consumer(bc, lock);
		Producer cm2 = new Producer(bc, lock);
		pool.execute(cm1);
		pool.execute(cm2);
	}
}
